# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=hash-identifier
pkgver=6.0e08a97
pkgrel=5
pkgdesc='Software to identify the different types of hashes used to encrypt data and especially passwords.'
groups=('blackarch' 'blackarch-crypto')
arch=('any')
url='https://github.com/blackploit/hash-identifier'
license=('custom:unknown')
depends=('python')
makedepends=('git' 'dos2unix')
source=("git+https://github.com/blackploit/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  dos2unix hash-id.py
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 hash-id.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  rm README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"
}

